Re: Timeout Script help needed please.

Re: Timeout Script help needed please.

am 14.09.2007 11:34:24 von Anthony Jones

"Bernie" wrote in message
news:OLztbwq9HHA.4200@TK2MSFTNGP04.phx.gbl...
> Hi
> I have a page that keeps timing out even after increasing the time. This
> page has been working fine before and I am aware that increasing the
timeout
> only serves as a 'bandaid' to fixing the problem and might mask any other
> errors. Can anyone give me any idea as to why this might be happening.
> The error message that comes up is:
>
> ASP 500 Error
> An error occurred processing the page you requested.
> Please see the details below for more information.
> IIS Error Number ASP 0113
> COM Error Number -2147467259 (0x80004005)
> File Name /orders/default.asp
> Line Number 0
> Brief Description Script timed out
> Full Description The maximum amount of time for a script to execute
> was exceeded. You can change this limit by specifying a new value for the
> property Server.ScriptTimeout or by changing the value in the IIS
> administration tools.
>
>

For each record found in rsCartsReceived the entire set for rows in the
rsCartItems will be looped. When the CartsReceived is large and the the
cartItems is large this is going to take awhile. The two recordsets should
be collapsed to a single recordset by making much better use of SQL. IOW,
add an Availablity column to the rsCartsReceived result set and drop the
other recordset altogether.

We can help you that but we need to understand the relationship between the
two tables involved. In particular is there a one-to-many relationship on
cartID from CartsQuery to CartsQueryItem? My guess is that that is so. Also
what DB are you using? SQL Server? :-

SELECT cq.CartID, cq.CustomerName, cq.Email, cq.OrderDate, cq.Receipt,
cq.WinebinendReceipt, ac.AvailabilityCheckError
FROM CartsQuery cq
LEFT JOIN (
SELECT CartID, 1 AvailabilityCheckError
FROM CartItemsQuery
WHERE AvailabilityCheck = 0
GROUP BY CartID) ac
ON ac.CartID = cq.CartID
WHERE Status = 'Received'
ORDER BY CartID DESC

In the javascript:-

if (rsCartsReceived.Fields.Item("AvailabilityCheckError ").Value == 1)
{
Response.Write(" rsCartsReceived.Fields.Item("CartID").Value + "\"> color=red>ERROR!")
}
else
{
Response.Write("Sent")
}

BTW why not do the adminstrator test before opening this recordset?


--
Anthony Jones - MVP ASP/ASP.NET